﻿@model LeadMaster.ViewModels.ViewModelContacts

@{
    ViewBag.Title = "Create";
}
<div class="spacer">
</div>
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Create Contact</legend>

        @Html.HiddenFor(m => m.Contact.ContactID)

        <div class="filterheaderlabel" style="width: 150px;">
            @Html.LabelFor(model => model.CompanyID)
        </div>
        <div class="filterheader">
            @Html.DropDownListFor(model => model.Contact.CompanyID, Model.Companies, "No Company", new { @class = "chzn-select", style = "width: 250px;" })
            @Html.ValidationMessageFor(model => model.Contact.CompanyID)
        </div>
        <div class="spacer"></div>
        <div class="spacer"></div>
        <div class="spacer"></div>
        <div class="spacer"></div>
        <div class="spacer"></div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Forename)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Forename)
            @Html.ValidationMessageFor(model => model.Contact.Forename)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Initials)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Initials)
            @Html.ValidationMessageFor(model => model.Contact.Initials)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Surname)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Surname)
            @Html.ValidationMessageFor(model => model.Contact.Surname)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Title)
            @Html.ValidationMessageFor(model => model.Contact.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Address1)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Address1)
            @Html.ValidationMessageFor(model => model.Contact.Address1)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Address2)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Address2)
            @Html.ValidationMessageFor(model => model.Contact.Address2)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.District)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.District)
            @Html.ValidationMessageFor(model => model.Contact.District)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Town)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Town)
            @Html.ValidationMessageFor(model => model.Contact.Town)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.County)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.County)
            @Html.ValidationMessageFor(model => model.Contact.County)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Postcode)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Postcode)
            @Html.ValidationMessageFor(model => model.Contact.Postcode)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Telephone)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Telephone)
            @Html.RadioButtonFor(model => model.Contact.DefaultTelephoneField, "Telephone")
            @Html.ValidationMessageFor(model => model.Contact.Telephone)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Tel2)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Tel2)
            @Html.RadioButtonFor(model => model.Contact.DefaultTelephoneField, "Tel2")
            @Html.ValidationMessageFor(model => model.Contact.Tel2)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Mobile1)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Mobile1)
            @Html.RadioButtonFor(model => model.Contact.DefaultTelephoneField, "Mobile1")
            @Html.ValidationMessageFor(model => model.Contact.Mobile1)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Mobile2)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Mobile2)
            @Html.RadioButtonFor(model => model.Contact.DefaultTelephoneField, "Mobile2")
            @Html.ValidationMessageFor(model => model.Contact.Mobile2)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.Email)
            @Html.ValidationMessageFor(model => model.Contact.Email)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Contact.WWW)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Contact.WWW)
            @Html.ValidationMessageFor(model => model.Contact.WWW)
        </div>

        <div style="clear:both;">
            <input type="submit" value="Create" />
        </div>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

<script src="~/Content/chosen/chosen.jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function () {
        $(".chzn-select").chosen();
    });
</script>
